home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / scobra.c < prev    next >
C/C++ Source or Header  |  2000-05-25  |  85KB  |  2,340 lines

  1. /***************************************************************************
  2.  
  3. Super Cobra and Co. memory map (preliminary)
  4.  
  5. Main CPU:
  6. --------
  7.  
  8. There seems to be 2 main board types:
  9.  
  10. Type 1      Type 2
  11.  
  12. 0000-7fff   0000-7fff    ROM (not all games use the entire range)
  13. 8000-87ff   8000-87ff    RAM
  14. 8800-8bff   9000-93ff    video RAM
  15. 9000-903f   8800-883f    screen attributes
  16. 9040-905f   8840-885f    sprites
  17. 9060-907f   8860-887f    bullets
  18.  
  19. read:
  20. b000          9800        watchdog reset
  21. 9800          a000        IN0
  22. 9801          a004        IN1
  23. 9802        a008        IN2
  24.  
  25. write:
  26. a801          b004        interrupt enable
  27. a802          b006        coin counter
  28. a803          b002        ? (POUT1)
  29. a804          b000        stars on
  30. a805          b00a        ? (POUT2)
  31. a806          b00e        screen vertical flip
  32. a807          b00c        screen horizontal flip
  33. a000          a800        To AY-3-8910 port A (commands for the audio CPU)
  34. a001          a804        bit 3 = trigger interrupt on audio CPU
  35.  
  36.  
  37. Sound CPU:
  38.  
  39. 0000-1fff   ROM
  40. 8000-83ff   RAM
  41. 9000-9fff   R/C Filter (2 bits for each of the 6 channels)
  42.  
  43. I/O:
  44.  
  45. 10          AY8910 #0 control
  46. 20            AY8910 #0 data port
  47. 40            AY8910 #1 control port
  48. 80            AY8910 #1 data port
  49.  
  50.  
  51. TODO:
  52. ----
  53.  
  54.     Need correct color PROMs for:
  55.         Super Bond
  56.  
  57. Notes:
  58. -----
  59.  
  60. - Calipso was apperantly redesigned for two player simultanious play.
  61.   There is code at $298a to flip the screen, but location $8669 has to be
  62.   set to 2. It's set to 1 no matter how many players are playing.
  63.   It's possible that there is a cocktail version of the game.
  64.  
  65. - Video Hustler and its two bootlegs all have identical code, the only
  66.   differences are the title, copyright removed, different encryptions or
  67.   no encryption, plus hustlerb has a different memory map.
  68.  
  69. - In Tazmania, when set to Upright mode, player 2 left skips the current
  70.   level
  71.  
  72. ***************************************************************************/
  73.  
  74. #include "driver.h"
  75. #include "vidhrdw/generic.h"
  76.  
  77.  
  78.  
  79. extern unsigned char *galaxian_attributesram;
  80. extern unsigned char *galaxian_bulletsram;
  81. extern size_t galaxian_bulletsram_size;
  82.  
  83. void galaxian_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  84. void rescue_vh_convert_color_prom  (unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  85. void minefld_vh_convert_color_prom (unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  86. void stratgyx_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  87.  
  88. int  scramble_vh_start(void);
  89. int  rescue_vh_start  (void);
  90. int  minefld_vh_start (void);
  91. int  calipso_vh_start (void);
  92. int  stratgyx_vh_start(void);
  93.  
  94. void galaxian_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  95. WRITE_HANDLER( galaxian_flipx_w );
  96. WRITE_HANDLER( galaxian_flipy_w );
  97. WRITE_HANDLER( galaxian_attributes_w );
  98. WRITE_HANDLER( galaxian_stars_w );
  99. int  scramble_vh_interrupt(void);
  100. WRITE_HANDLER( scramble_background_w );
  101. WRITE_HANDLER( scramble_filter_w );
  102.  
  103. READ_HANDLER( scramble_portB_r );
  104. READ_HANDLER( frogger_portB_r );
  105. WRITE_HANDLER( scramble_sh_irqtrigger_w );
  106.  
  107.  
  108. static void scobra_init_machine(void)
  109. {
  110.     /* we must start with NMI interrupts disabled, otherwise some games */
  111.     /* (e.g. Lost Tomb, Rescue) will not pass the startup test. */
  112.     interrupt_enable_w(0,0);
  113. }
  114.  
  115. static READ_HANDLER( moonwar2_IN0_r )
  116. {
  117.     int sign;
  118.     int delta;
  119.  
  120.     delta = readinputport(3);
  121.  
  122.     sign = (delta & 0x80) >> 3;
  123.     delta &= 0x0f;
  124.  
  125.     return ((readinputport(0) & 0xe0) | delta | sign );
  126. }
  127.  
  128. static WRITE_HANDLER( stratgyx_coin_counter_w )
  129. {
  130.     /* Bit 1 selects coin counter */
  131.     coin_counter_w(offset >> 1, data);
  132. }
  133.  
  134.  
  135. static struct MemoryReadAddress type1_readmem[] =
  136. {
  137.     { 0x0000, 0x7fff, MRA_ROM },
  138.     { 0x8000, 0x8bff, MRA_RAM },    /* RAM and Video RAM */
  139.     { 0x9000, 0x907f, MRA_RAM },    /* screen attributes, sprites, bullets */
  140.     { 0x9800, 0x9800, input_port_0_r },    /* IN0 */
  141.     { 0x9801, 0x9801, input_port_1_r },    /* IN1 */
  142.     { 0x9802, 0x9802, input_port_2_r },    /* IN2 */
  143.     { 0xb000, 0xb000, watchdog_reset_r },
  144.     { -1 }    /* end of table */
  145. };
  146.  
  147. static struct MemoryWriteAddress type1_writemem[] =
  148. {
  149.     { 0x0000, 0x7fff, MWA_ROM },
  150.     { 0x8000, 0x87ff, MWA_RAM },
  151.     { 0x8800, 0x8bff, videoram_w, &videoram, &videoram_size },
  152.     { 0x8c00, 0x8fff, MWA_NOP},
  153.     { 0x9000, 0x903f, galaxian_attributes_w, &galaxian_attributesram },
  154.     { 0x9040, 0x905f, MWA_RAM, &spriteram, &spriteram_size },
  155.     { 0x9060, 0x907f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  156.     { 0x9080, 0x90ff, MWA_NOP},
  157.     { 0xa000, 0xa000, soundlatch_w },
  158.     { 0xa001, 0xa001, scramble_sh_irqtrigger_w },
  159.     { 0xa801, 0xa801, interrupt_enable_w },
  160.     { 0xa802, 0xa802, coin_counter_w },
  161.     { 0xa803, 0xa803, scramble_background_w },
  162.     { 0xa804, 0xa804, galaxian_stars_w },
  163.     { 0xa806, 0xa806, galaxian_flipx_w },
  164.     { 0xa807, 0xa807, galaxian_flipy_w },
  165.     { -1 }    /* end of table */
  166. };
  167.  
  168. static struct MemoryReadAddress type2_readmem[] =
  169. {
  170.     { 0x0000, 0x7fff, MRA_ROM },
  171.     { 0x8000, 0x8bff, MRA_RAM },    /* RAM and Video RAM */
  172.     { 0x9000, 0x93ff, MRA_RAM },    /* screen attributes, sprites, bullets */
  173.     { 0x9800, 0x9800, watchdog_reset_r},
  174.     { 0xa000, 0xa000, input_port_0_r },    /* IN0 */
  175.     { 0xa004, 0xa004, input_port_1_r },    /* IN1 */
  176.     { 0xa008, 0xa008, input_port_2_r },    /* IN2 */
  177.     { -1 }    /* end of table */
  178. };
  179.  
  180. static struct MemoryWriteAddress type2_writemem[] =
  181. {
  182.     { 0x0000, 0x7fff, MWA_ROM },
  183.     { 0x8000, 0x87ff, MWA_RAM },
  184.     { 0x8800, 0x883f, galaxian_attributes_w, &galaxian_attributesram },
  185.     { 0x8840, 0x885f, MWA_RAM, &spriteram, &spriteram_size },
  186.     { 0x8860, 0x887f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  187.     { 0x8880, 0x88ff, MWA_NOP},
  188.     { 0x9000, 0x93ff, videoram_w, &videoram, &videoram_size },
  189.     { 0xa800, 0xa800, soundlatch_w },
  190.     { 0xa804, 0xa804, scramble_sh_irqtrigger_w },
  191.     { 0xb000, 0xb000, galaxian_stars_w },
  192.     { 0xb002, 0xb002, scramble_background_w },
  193.     { 0xb004, 0xb004, interrupt_enable_w },
  194.     { 0xb006, 0xb008, stratgyx_coin_counter_w },
  195.     { 0xb00c, 0xb00c, galaxian_flipy_w },
  196.     { 0xb00e, 0xb00e, galaxian_flipx_w },
  197.     { -1 }    /* end of table */
  198. };
  199.  
  200. static struct MemoryReadAddress hustler_readmem[] =
  201. {
  202.     { 0x0000, 0x3fff, MRA_ROM },
  203.     { 0x8000, 0x8bff, MRA_RAM },    /* RAM and Video RAM */
  204.     { 0x9000, 0x907f, MRA_RAM },    /* screen attributes, sprites, bullets */
  205.     { 0xb800, 0xb800, watchdog_reset_r },
  206.     { 0xd000, 0xd000, input_port_0_r },    /* IN0 */
  207.     { 0xd008, 0xd008, input_port_1_r },    /* IN1 */
  208.     { 0xd010, 0xd010, input_port_2_r },    /* IN2 */
  209.     { -1 }    /* end of table */
  210. };
  211.  
  212. static struct MemoryWriteAddress hustler_writemem[] =
  213. {
  214.     { 0x0000, 0x3fff, MWA_ROM },
  215.     { 0x8000, 0x87ff, MWA_RAM },
  216.     { 0x8800, 0x8bff, videoram_w, &videoram, &videoram_size },
  217.     { 0x9000, 0x903f, galaxian_attributes_w, &galaxian_attributesram },
  218.     { 0x9040, 0x905f, MWA_RAM, &spriteram, &spriteram_size },
  219.     { 0x9060, 0x907f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  220.     { 0xa802, 0xa802, galaxian_flipx_w },
  221.     { 0xa804, 0xa804, interrupt_enable_w },
  222.     { 0xa806, 0xa806, galaxian_flipy_w },
  223.     { 0xa80e, 0xa80e, MWA_NOP },    /* coin counters */
  224.     { 0xe000, 0xe000, soundlatch_w },
  225.     { 0xe008, 0xe008, scramble_sh_irqtrigger_w },
  226.     { -1 }    /* end of table */
  227. };
  228.  
  229. static struct MemoryReadAddress hustlerb_readmem[] =
  230. {
  231.     { 0x0000, 0x3fff, MRA_ROM },
  232.     { 0x8000, 0x8bff, MRA_RAM },    /* RAM and Video RAM */
  233.     { 0x9000, 0x907f, MRA_RAM },    /* screen attributes, sprites, bullets */
  234.     { 0xb000, 0xb000, watchdog_reset_r },
  235.     { 0xc100, 0xc100, input_port_0_r },    /* IN0 */
  236.     { 0xc101, 0xc101, input_port_1_r },    /* IN1 */
  237.     { 0xc102, 0xc102, input_port_2_r },    /* IN2 */
  238.     { -1 }    /* end of table */
  239. };
  240.  
  241. static struct MemoryWriteAddress hustlerb_writemem[] =
  242. {
  243.     { 0x0000, 0x3fff, MWA_ROM },
  244.     { 0x8000, 0x87ff, MWA_RAM },
  245.     { 0x8800, 0x8bff, videoram_w, &videoram, &videoram_size },
  246.     { 0x9000, 0x903f, galaxian_attributes_w, &galaxian_attributesram },
  247.     { 0x9040, 0x905f, MWA_RAM, &spriteram, &spriteram_size },
  248.     { 0x9060, 0x907f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  249.     { 0xa801, 0xa801, interrupt_enable_w },
  250.     { 0xa802, 0xa802, MWA_NOP },    /* coin counters */
  251.     { 0xa806, 0xa806, galaxian_flipy_w },
  252.     { 0xa807, 0xa807, galaxian_flipx_w },
  253.     { 0xc200, 0xc200, soundlatch_w },
  254.     { 0xc201, 0xc201, scramble_sh_irqtrigger_w },
  255.     { -1 }    /* end of table */
  256. };
  257.  
  258.  
  259. static struct MemoryReadAddress sound_readmem[] =
  260. {
  261.     { 0x0000, 0x1fff, MRA_ROM },
  262.     { 0x8000, 0x83ff, MRA_RAM },
  263.     { -1 }    /* end of table */
  264. };
  265.  
  266. static struct MemoryWriteAddress sound_writemem[] =
  267. {
  268.     { 0x0000, 0x1fff, MWA_ROM },
  269.     { 0x8000, 0x83ff, MWA_RAM },
  270.     { 0x9000, 0x9fff, scramble_filter_w },
  271.     { -1 }    /* end of table */
  272. };
  273.  
  274. static struct MemoryReadAddress hustler_sound_readmem[] =
  275. {
  276.     { 0x0000, 0x0fff, MRA_ROM },
  277.     { 0x4000, 0x43ff, MRA_RAM },
  278.     { -1 }    /* end of table */
  279. };
  280.  
  281. static struct MemoryWriteAddress hustler_sound_writemem[] =
  282. {
  283.     { 0x0000, 0x0fff, MWA_ROM },
  284.     { 0x4000, 0x43ff, MWA_RAM },
  285.     { -1 }    /* end of table */
  286. };
  287.  
  288. static struct IOReadPort sound_readport[] =
  289. {
  290.     { 0x20, 0x20, AY8910_read_port_0_r },
  291.     { 0x80, 0x80, AY8910_read_port_1_r },
  292.     { -1 }    /* end of table */
  293. };
  294.  
  295. static struct IOWritePort sound_writeport[] =
  296. {
  297.     { 0x10, 0x10, AY8910_control_port_0_w },
  298.     { 0x20, 0x20, AY8910_write_port_0_w },
  299.     { 0x40, 0x40, AY8910_control_port_1_w },
  300.     { 0x80, 0x80, AY8910_write_port_1_w },
  301.     { -1 }    /* end of table */
  302. };
  303.  
  304. static struct IOReadPort hustler_sound_readport[] =
  305. {
  306.     { 0x40, 0x40, AY8910_read_port_0_r },
  307.     { -1 }    /* end of table */
  308. };
  309.  
  310. static struct IOWritePort hustler_sound_writeport[] =
  311. {
  312.     { 0x40, 0x40, AY8910_write_port_0_w },
  313.     { 0x80, 0x80, AY8910_control_port_0_w },
  314.     { -1 }    /* end of table */
  315. };
  316.  
  317. static struct IOReadPort hustlerb_sound_readport[] =
  318. {
  319.     { 0x80, 0x80, AY8910_read_port_0_r },
  320.     { -1 }    /* end of table */
  321. };
  322.  
  323. static struct IOWritePort hustlerb_sound_writeport[] =
  324. {
  325.     { 0x40, 0x40, AY8910_control_port_0_w },
  326.     { 0x80, 0x80, AY8910_write_port_0_w },
  327.     { -1 }    /* end of table */
  328. };
  329.  
  330.  
  331. INPUT_PORTS_START( scobra )
  332.     PORT_START      /* IN0 */
  333.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  334.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  335.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  336.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  337.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  338.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  339.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
  340.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  341.  
  342.     PORT_START      /* IN1 */
  343.     PORT_DIPNAME( 0x01, 0x00, "Allow Continue" )
  344.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  345.     PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
  346.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
  347.     PORT_DIPSETTING(    0x00, "3" )
  348.     PORT_DIPSETTING(    0x02, "5" )
  349.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  350.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  351.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  352.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  353.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  354.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  355.  
  356.     PORT_START      /* IN2 */
  357.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  358.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  359.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  360.     PORT_DIPSETTING(    0x06, DEF_STR( 4C_3C ) )
  361.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  362.     PORT_DIPSETTING(    0x00, "1 Coin/99 Credits" )
  363.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  364.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  365.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  366.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  367.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  368.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  369.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  370. INPUT_PORTS_END
  371.  
  372. /* identical to scobra apart from the number of lives */
  373. INPUT_PORTS_START( scobrak )
  374.     PORT_START      /* IN0 */
  375.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  376.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  377.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
  378.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  379.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  380.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  381.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
  382.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  383.  
  384.     PORT_START      /* IN1 */
  385.     PORT_DIPNAME( 0x01, 0x00, "Allow Continue" )
  386.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  387.     PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
  388.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
  389.     PORT_DIPSETTING(    0x00, "3" )
  390.     PORT_DIPSETTING(    0x02, "4" )
  391.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  392.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  393.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  394.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  395.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  396.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  397.  
  398.     PORT_START      /* IN2 */
  399.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  400.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  401.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  402.     PORT_DIPSETTING(    0x06, DEF_STR( 4C_3C ) )
  403.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  404.     PORT_DIPSETTING(    0x00, "1 Coin/99 Credits" )
  405.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  406.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  407.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  408.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  409.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  410.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  411.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  412. INPUT_PORTS_END
  413.  
  414. INPUT_PORTS_START( stratgyx )
  415.     PORT_START      /* IN0 */
  416.     PORT_BIT( 0x81, IP_ACTIVE_LOW, IPT_UNKNOWN )
  417.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  418.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
  419.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  420.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  421.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  422.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
  423.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
  424.  
  425.     PORT_START      /* IN1 */
  426.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  427.     PORT_DIPSETTING(    0x00, "3" )
  428.     PORT_DIPSETTING(    0x01, "4" )
  429.     PORT_DIPSETTING(    0x02, "5" )
  430.     PORT_BITX( 0,       0x03, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "99", IP_KEY_NONE, IP_JOY_NONE )
  431.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  432.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  433.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  434.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  435.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  436.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  437.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   | IPF_8WAY )
  438.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  439.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  440.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  441.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2  )
  442.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  443.  
  444.     PORT_START      /* IN2 */
  445.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  446.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  447.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  448.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  449.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  450.     PORT_DIPSETTING(    0x06, DEF_STR( 4C_3C ) )
  451.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  452.     PORT_DIPSETTING(    0x00, "1 Coin/99 Credits" )
  453.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  454.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  455.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  456.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   | IPF_8WAY )
  457.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
  458.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  459.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  460.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  461.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  462. INPUT_PORTS_END
  463.  
  464. INPUT_PORTS_START( armorcar )
  465.     PORT_START    /* IN0 */
  466.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  467.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  468.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
  469.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  470.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  471.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  472.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  473.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  474.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  475.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  476.  
  477.     PORT_START    /* IN1 */
  478.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
  479.     PORT_DIPSETTING(    0x01, "3" )
  480.     PORT_DIPSETTING(    0x00, "5" )
  481.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
  482.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  483.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  484.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  485.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  486.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  487.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  488.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  489.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  490.  
  491.     PORT_START    /* IN2 */
  492.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  493.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  494.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  495.     PORT_DIPSETTING(    0x00, "Coin A 1/2 Coin B 2/1" )
  496.     PORT_DIPSETTING(    0x04, "Coin A 1/3 Coin B 3/1" )
  497.     PORT_DIPSETTING(    0x06, "Coin A 1/4 Coin B 4/1" )
  498.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
  499.     PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
  500.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  501.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
  502.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  503.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  504.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  505.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
  506.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  507.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  508.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  509. INPUT_PORTS_END
  510.  
  511. INPUT_PORTS_START( moonwar2 )
  512.     PORT_START      /* IN0 */
  513.     PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* the spinner */
  514.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
  515.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  516.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  517.  
  518.     PORT_START      /* IN1 */
  519.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  520.     PORT_DIPSETTING(    0x00, "3" )
  521.     PORT_DIPSETTING(    0x01, "4" )
  522.     PORT_DIPSETTING(    0x02, "5" )
  523.     PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
  524.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
  525.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
  526.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
  527.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
  528.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
  529.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  530.  
  531.     PORT_START      /* IN2 */
  532.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  533.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  534.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  535.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  536.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  537.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
  538.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
  539.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_4C ) )
  540.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  541.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  542.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  543.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  544.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  545.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  546.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  547.  
  548.     PORT_START      /* IN3 - dummy port for the dial */
  549.     PORT_ANALOG( 0xff, 0x00, IPT_DIAL | IPF_CENTER, 25, 10, 0, 0 )
  550. INPUT_PORTS_END
  551.  
  552. INPUT_PORTS_START( monwar2a )
  553.     PORT_START      /* IN0 */
  554.     PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* the spinner */
  555.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
  556.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  557.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  558.  
  559.     PORT_START      /* IN1 */
  560.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  561.     PORT_DIPSETTING(    0x00, "3" )
  562.     PORT_DIPSETTING(    0x01, "4" )
  563.     PORT_DIPSETTING(    0x02, "5" )
  564.     PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
  565.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
  566.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
  567.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
  568.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
  569.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
  570.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
  571.  
  572.     PORT_START      /* IN2 */
  573.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  574.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  575.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  576.     PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
  577.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  578.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  579.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
  580.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_4C ) )
  581.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  582.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  583.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  584.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  585.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  586.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  587.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  588.  
  589.     PORT_START      /* IN3 - dummy port for the dial */
  590.     PORT_ANALOG( 0xff, 0x00, IPT_DIAL | IPF_CENTER, 25, 10, 0, 0 )
  591. INPUT_PORTS_END
  592.  
  593. INPUT_PORTS_START( spdcoin )
  594.     PORT_START      /* IN0 */
  595.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  596.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
  597.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  598.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
  599.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
  600.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
  601.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  602.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  603.  
  604.     PORT_START      /* IN1 */
  605.     PORT_DIPNAME( 0x01, 0x00, "Freeze" )   /* Dip Sw #2 */
  606.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  607.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  608.     PORT_DIPNAME( 0x02, 0x02, DEF_STR ( Unknown ) ) /* Dip Sw #1 */
  609.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  610.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  611.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  612.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
  613.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
  614.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  615.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  616.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  617.  
  618.     PORT_START      /* IN2 */
  619.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
  620.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )    /* Dip Sw #5 */
  621.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  622.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  623.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )    /* Dip Sw #4 */
  624.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  625.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  626.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) )    /* Dip Sw #3 */
  627.     PORT_DIPSETTING(    0x08, "3" )
  628.     PORT_DIPSETTING(    0x00, "5" )
  629.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
  630.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  631.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  632.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  633.  
  634.     PORT_START      /* IN3 - dummy port for the dial */
  635.     PORT_ANALOG( 0xff, 0x00, IPT_DIAL | IPF_CENTER, 25, 10, 0, 0 )
  636. INPUT_PORTS_END
  637.  
  638. INPUT_PORTS_START( darkplnt )
  639.     PORT_START    /* IN0 */
  640.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  641.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
  642.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
  643.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  644.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  645.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  646.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  647.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  648.  
  649.     PORT_START    /* IN1 */
  650.     PORT_DIPNAME( 0x01, 0x01, "Bonus Occurrence" )
  651.     PORT_DIPSETTING(    0x01, "Once" )
  652.     PORT_DIPSETTING(    0x00, "Every" )
  653.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
  654.     PORT_DIPSETTING(    0x00, "3" )
  655.     PORT_DIPSETTING(    0x02, "5" )
  656.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
  657.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
  658.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
  659.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
  660.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
  661.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 )
  662.  
  663.     PORT_START    /* IN2 */
  664.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
  665.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  666.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  667.     PORT_DIPSETTING(    0x00, "Coin A 1/2 Coin B 2/1" )
  668.     PORT_DIPSETTING(    0x04, "Coin A 1/3 Coin B 3/1" )
  669.     PORT_DIPSETTING(    0x06, "Coin A 1/4 Coin B 4/1" )
  670.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
  671.     PORT_DIPSETTING(    0x00, "100k" )
  672.     PORT_DIPSETTING(    0x08, "200k" )
  673.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  674.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  675.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  676.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  677. INPUT_PORTS_END
  678.  
  679. INPUT_PORTS_START( tazmania )
  680.     PORT_START    /* IN0 */
  681.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
  682.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
  683.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  684.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  685.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  686.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  687.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  688.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  689.  
  690.     PORT_START    /* IN1 */
  691.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
  692.     PORT_DIPSETTING(    0x01, "3" )
  693.     PORT_DIPSETTING(    0x00, "5" )
  694.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
  695.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  696.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  697.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  698.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  699.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  700.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  701.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  702.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  703.  
  704.     PORT_START    /* IN2 */
  705.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  706.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  707.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  708.     PORT_DIPSETTING(    0x00, "Coin A 1/2 Coin B 2/1" )
  709.     PORT_DIPSETTING(    0x04, "Coin A 1/3 Coin B 3/1" )
  710.     PORT_DIPSETTING(    0x06, "Coin A 1/4 Coin B 4/1" )
  711.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
  712.     PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
  713.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  714.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  715.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  716.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  717.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  718.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  719.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  720.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  721.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  722.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  723.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  724. INPUT_PORTS_END
  725.  
  726. /* Cocktail mode is N/A */
  727. INPUT_PORTS_START( calipso )
  728.     PORT_START      /* IN0 */
  729.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  730.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  731.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  732.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  733.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  734.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  735.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  736.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  737.  
  738.     PORT_START      /* IN1 */
  739.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
  740.     PORT_DIPSETTING(    0x01, "3" )
  741.     PORT_DIPSETTING(    0x00, "5" )
  742.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
  743.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  744.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  745.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  746.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  747.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  748.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  749.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  750.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  751.  
  752.     PORT_START      /* IN2 */
  753.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  754.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  755.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  756.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
  757.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
  758.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_4C ) )
  759.     PORT_DIPNAME( 0x08, 0x08, "Cabinet (Not Supported)" )
  760.     PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
  761.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  762.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  763.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  764.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  765.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  766. INPUT_PORTS_END
  767.  
  768. /* Cocktail mode not working due to bug */
  769. INPUT_PORTS_START( anteater )
  770.     PORT_START    /* IN0 */
  771.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  772.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  773.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )
  774.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  775.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  776.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  777.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  778.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  779.  
  780.     PORT_START    /* IN1 */
  781.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
  782.     PORT_DIPSETTING(    0x01, "3" )
  783.     PORT_DIPSETTING(    0x00, "5" )
  784.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
  785.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  786.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  787.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  788.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  789.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  790.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  791.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  792.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  793.  
  794.     PORT_START    /* IN2 */
  795.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  796.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  797.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  798.     PORT_DIPSETTING(    0x00, "Coin A 1/2 Coin B 2/1" )
  799.     PORT_DIPSETTING(    0x04, "Coin A 1/3 Coin B 3/1" )
  800.     PORT_DIPSETTING(    0x06, "Coin A 1/4 Coin B 4/1" )
  801.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
  802.     PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
  803.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  804.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  805.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  806.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  807.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  808.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  809.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  810.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  811.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  812.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  813.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  814. INPUT_PORTS_END
  815.  
  816. INPUT_PORTS_START( rescue )
  817.     PORT_START    /* IN0 */
  818.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  819.     PORT_DIPNAME( 0x02, 0x02, "Starting Level" )
  820.     PORT_DIPSETTING(    0x02, "1" )
  821.     PORT_DIPSETTING(    0x00, "3" )
  822.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP    | IPF_8WAY )
  823.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN  | IPF_8WAY )
  824.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_8WAY )
  825.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT  | IPF_8WAY )
  826.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  827.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  828.  
  829.     PORT_START    /* IN1 */
  830.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
  831.     PORT_DIPSETTING(    0x01, "3" )
  832.     PORT_DIPSETTING(    0x00, "5" )
  833.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
  834.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  835.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  836.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY )
  837.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY )
  838.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY )
  839.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY )
  840.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  841.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  842.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  843.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  844.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  845.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  846.  
  847.     PORT_START    /* IN2 */
  848.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  849.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  850.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  851.     PORT_DIPSETTING(    0x00, "Coin A 1/2 Coin B 2/1" )
  852.     PORT_DIPSETTING(    0x04, "Coin A 1/3 Coin B 3/1" )
  853.     PORT_DIPSETTING(    0x06, "Coin A 1/4 Coin B 4/1" )
  854.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Difficulty ) )
  855.     PORT_DIPSETTING(    0x00, "Easy" )
  856.     PORT_DIPSETTING(    0x08, "Hard" )
  857.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  858.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  859.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  860.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  861.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  862.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  863.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  864.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  865.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  866.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  867. INPUT_PORTS_END
  868.  
  869. INPUT_PORTS_START( minefld )
  870.     PORT_START    /* IN0 */
  871.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  872.     PORT_DIPNAME( 0x02, 0x02, "Starting Level" )
  873.     PORT_DIPSETTING(    0x02, "1" )
  874.     PORT_DIPSETTING(    0x00, "3" )
  875.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP    | IPF_8WAY )
  876.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN  | IPF_8WAY )
  877.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_8WAY )
  878.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT  | IPF_8WAY )
  879.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  880.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  881.  
  882.     PORT_START    /* IN1 */
  883.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
  884.     PORT_DIPSETTING(    0x01, "3" )
  885.     PORT_DIPSETTING(    0x00, "5" )
  886.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
  887.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  888.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  889.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY )
  890.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY )
  891.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY )
  892.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY )
  893.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  894.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  895.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  896.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  897.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  898.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  899.  
  900.     PORT_START    /* IN2 */
  901.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  902.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Coinage ) )
  903.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  904.     PORT_DIPSETTING(    0x00, "Coin A 1/2 Coin B 2/1" )
  905.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
  906.     PORT_DIPSETTING(    0x0c, "Easy" )
  907.     PORT_DIPSETTING(    0x08, "Medium" )
  908.     PORT_DIPSETTING(    0x04, "Hard" )
  909.     PORT_DIPSETTING(    0x00, "Hardest" )
  910.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  911.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  912.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  913.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  914.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  915.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  916.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  917.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  918.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  919.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  920. INPUT_PORTS_END
  921.  
  922. /* Cocktail mode is N/A */
  923. INPUT_PORTS_START( losttomb )
  924.     PORT_START      /* IN0 */
  925.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
  926.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
  927.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP    | IPF_8WAY )
  928.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN  | IPF_8WAY )
  929.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_8WAY)
  930.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT  | IPF_8WAY )
  931.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  932.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  933.  
  934.     PORT_START      /* IN1 */
  935.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
  936.     PORT_DIPSETTING(    0x01, "3" )
  937.     PORT_DIPSETTING(    0x02, "5" )
  938.     PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
  939.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  940.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP    | IPF_8WAY )
  941.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN  | IPF_8WAY )
  942.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_8WAY)
  943.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT  | IPF_8WAY )
  944.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
  945.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  946.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  947.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  948.  
  949.     PORT_START      /* DSW0 */
  950.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  951.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  952.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  953.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  954.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  955.     PORT_DIPSETTING(    0x00, "A 1/2 B 2/1" )
  956.     PORT_DIPSETTING(    0x04, "A 1/3 B 3/1" )
  957.     PORT_DIPSETTING(    0x06, "A 1/4 B 4/1" )
  958.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  959.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  960.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  961.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  962.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  963.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  964.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  965.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  966.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  967.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  968.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  969.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  970.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  971.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  972.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  973. INPUT_PORTS_END
  974.  
  975. /* Cocktail mode is N/A */
  976. INPUT_PORTS_START( superbon )
  977.     PORT_START    /* IN0 */
  978.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
  979.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
  980.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  981.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  982.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY)
  983.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  984.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  985.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
  986.  
  987.     PORT_START    /* IN1 */
  988.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
  989.     PORT_DIPSETTING(    0x01, "3" )
  990.     PORT_DIPSETTING(    0x02, "5" )
  991.     PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
  992.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  993.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  994.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  995.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  996.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  997.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  998.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  999.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1000.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  1001.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1002.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1003.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1004.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  1005.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1006.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1007.  
  1008.     PORT_START    /* DSW0 */
  1009.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  1010.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  1011.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1012.     PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
  1013.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  1014.     PORT_DIPSETTING(    0x00, "A 1/2 B 2/1" )
  1015.     PORT_DIPSETTING(    0x04, "A 1/3 B 3/1" )
  1016.     PORT_DIPSETTING(    0x06, "A 1/4 B 4/1" )
  1017.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  1018.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  1019.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1020.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  1021.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1022.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1023.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  1024.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1025.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1026.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  1027.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1028.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1029.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  1030.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1031.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1032. INPUT_PORTS_END
  1033.  
  1034. INPUT_PORTS_START( hustler )
  1035.     PORT_START      /* IN0 */
  1036.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  1037.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1038.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
  1039.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1040.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  1041.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  1042.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
  1043.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
  1044.  
  1045.     PORT_START      /* IN1 */
  1046.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
  1047.     PORT_DIPSETTING(    0x00, "1" )
  1048.     PORT_DIPSETTING(    0x01, "2" )
  1049.     PORT_BITX(    0x02, 0x00, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Infinite Lives", IP_KEY_NONE, IP_JOY_NONE )
  1050.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1051.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  1052.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1053.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  1054.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  1055.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  1056.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  1057.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  1058.  
  1059.     PORT_START      /* IN2 */
  1060.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  1061.     PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
  1062.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
  1063.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  1064.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1065.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
  1066.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  1067.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1068.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  1069.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  1070.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1071.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  1072.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1073. INPUT_PORTS_END
  1074.  
  1075.  
  1076.  
  1077. static struct GfxLayout charlayout =
  1078. {
  1079.     8,8,    /* 8*8 characters */
  1080.     256,    /* 256 characters */
  1081.     2,    /* 2 bits per pixel */
  1082.     { 0, 256*8*8 },    /* the two bitplanes are separated */
  1083.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1084.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1085.     8*8    /* every char takes 8 consecutive bytes */
  1086. };
  1087. static struct GfxLayout spritelayout =
  1088. {
  1089.     16,16,    /* 16*16 sprites */
  1090.     64,    /* 64 sprites */
  1091.     2,    /* 2 bits per pixel */
  1092.     { 0, 64*16*16 },    /* the two bitplanes are separated */
  1093.     { 0, 1, 2, 3, 4, 5, 6, 7,
  1094.             8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  1095.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  1096.             16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  1097.     32*8    /* every sprite takes 32 consecutive bytes */
  1098. };
  1099. static struct GfxLayout bulletlayout =
  1100. {
  1101.     /* there is no gfx ROM for this one, it is generated by the hardware */
  1102.     7,1,    /* it's just 1 pixel, but we use 7*1 to position it correctly */
  1103.     1,    /* just one */
  1104.     1,    /* 1 bit per pixel */
  1105.     { 17*8*8 },    /* point to letter "A" */
  1106.     { 3, 0, 0, 0, 0, 0, 0 },    /* I "know" that this bit of the */
  1107.     { 1*8 },                        /* graphics ROMs is 1 */
  1108.     0    /* no use */
  1109. };
  1110. static struct GfxLayout armorcar_bulletlayout =
  1111. {
  1112.     /* there is no gfx ROM for this one, it is generated by the hardware */
  1113.     7,1,    /* 4*1 line, I think - 7*1 to position it correctly */
  1114.     1,    /* just one */
  1115.     1,    /* 1 bit per pixel */
  1116.     { 0 },
  1117.     { 2, 2, 2, 2, 0, 0, 0 },    /* I "know" that this bit of the */
  1118.     { 8 },                        /* graphics ROMs is 1 */
  1119.     0    /* no use */
  1120. };
  1121.  
  1122. static struct GfxLayout calipso_charlayout =
  1123. {
  1124.     8,8,    /* 8*8 characters */
  1125.     1024,    /* 1024 characters */
  1126.     2,    /* 2 bits per pixel */
  1127.     { 0, 1024*8*8 },    /* the two bitplanes are separated */
  1128.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1129.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1130.     8*8    /* every char takes 8 consecutive bytes */
  1131. };
  1132. static struct GfxLayout calipso_spritelayout =
  1133. {
  1134.     16,16,    /* 16*16 sprites */
  1135.     256,    /* 256 sprites */
  1136.     2,    /* 2 bits per pixel */
  1137.     { 0, 256*16*16 },    /* the two bitplanes are separated */
  1138.     { 0, 1, 2, 3, 4, 5, 6, 7,
  1139.             8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  1140.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  1141.             16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  1142.     32*8    /* every sprite takes 32 consecutive bytes */
  1143. };
  1144. static struct GfxLayout backgroundlayout =
  1145. {
  1146.     /* there is no gfx ROM for this one, it is generated by the hardware */
  1147.     8,8,
  1148.     32,    /* one for each column */
  1149.     7,    /* 128 colors max */
  1150.     { 1, 2, 3, 4, 5, 6, 7 },
  1151.     { 0*8*8, 1*8*8, 2*8*8, 3*8*8, 4*8*8, 5*8*8, 6*8*8, 7*8*8 },
  1152.     { 0, 8, 16, 24, 32, 40, 48, 56 },
  1153.     8*8*8    /* each character takes 64 bytes */
  1154. };
  1155.  
  1156.  
  1157. static struct GfxDecodeInfo gfxdecodeinfo[] =
  1158. {
  1159.     { REGION_GFX1, 0, &charlayout,     0, 8 },
  1160.     { REGION_GFX1, 0, &spritelayout,   0, 8 },
  1161.     { REGION_GFX1, 0, &bulletlayout, 8*4, 1 },    /* 1 color code instead of 2, so all */
  1162.                                             /* shots will be yellow */
  1163.     { 0,           0, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1164.     { -1 } /* end of array */
  1165. };
  1166.  
  1167. static struct GfxDecodeInfo armorcar_gfxdecodeinfo[] =
  1168. {
  1169.     { REGION_GFX1, 0, &charlayout,     0, 8 },
  1170.     { REGION_GFX1, 0, &spritelayout,   0, 8 },
  1171.     { REGION_GFX1, 0, &armorcar_bulletlayout, 8*4, 2 },
  1172.     { 0,           0, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1173.     { -1 } /* end of array */
  1174. };
  1175.  
  1176. static struct GfxDecodeInfo calipso_gfxdecodeinfo[] =
  1177. {
  1178.     { REGION_GFX1, 0, &calipso_charlayout,     0, 8 },
  1179.     { REGION_GFX1, 0, &calipso_spritelayout,   0, 8 },
  1180.     { REGION_GFX1, 0, &bulletlayout, 8*4, 1 },    /* 1 color code instead of 2, so all */
  1181.                                             /* shots will be yellow */
  1182.     { 0,           0, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1183.     { -1 } /* end of array */
  1184. };
  1185.  
  1186.  
  1187.  
  1188. static struct AY8910interface ay8910_interface =
  1189. {
  1190.     2,    /* 2 chips */
  1191.     14318000/8,    /* 1.78975 Mhz */
  1192.     /* Ant Eater clips if the volume is set higher than this */
  1193.     { MIXERG(16,MIXER_GAIN_2x,MIXER_PAN_CENTER), MIXERG(16,MIXER_GAIN_2x,MIXER_PAN_CENTER) },
  1194.     { 0, soundlatch_r },
  1195.     { 0, scramble_portB_r },
  1196.     { 0 },
  1197.     { 0 }
  1198. };
  1199.  
  1200. static struct AY8910interface hustler_ay8910_interface =
  1201. {
  1202.     1,    /* 1 chip */
  1203.     14318000/8,    /* 1.78975 Mhz */
  1204.     { 80 },
  1205.     { soundlatch_r },
  1206.     { frogger_portB_r },
  1207.     { 0 },
  1208.     { 0 }
  1209. };
  1210.  
  1211.  
  1212.  
  1213. static struct MachineDriver machine_driver_type1 =
  1214. {
  1215.     /* basic machine hardware */
  1216.     {
  1217.         {
  1218.             CPU_Z80,
  1219.             18432000/6,    /* 3.072 Mhz */
  1220.             type1_readmem,type1_writemem,0,0,
  1221.             scramble_vh_interrupt,1
  1222.         },
  1223.         {
  1224.             CPU_Z80 | CPU_AUDIO_CPU,
  1225.             14318000/8,    /* 1.78975 Mhz */
  1226.             sound_readmem,sound_writemem,sound_readport,sound_writeport,
  1227.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  1228.         }
  1229.     },
  1230.     60, 2500,    /* frames per second, vblank duration */
  1231.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1232.     scobra_init_machine,
  1233.  
  1234.     /* video hardware */
  1235.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1236.     gfxdecodeinfo,
  1237.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  1238.     galaxian_vh_convert_color_prom,
  1239.  
  1240.     VIDEO_TYPE_RASTER,
  1241.     0,
  1242.     scramble_vh_start,
  1243.     generic_vh_stop,
  1244.     galaxian_vh_screenrefresh,
  1245.  
  1246.     /* sound hardware */
  1247.     0,0,0,0,
  1248.     {
  1249.         {
  1250.             SOUND_AY8910,
  1251.             &ay8910_interface
  1252.         }
  1253.     }
  1254. };
  1255.  
  1256. /* same as the above, the only difference is in gfxdecodeinfo to have long bullets */
  1257. static struct MachineDriver machine_driver_armorcar =
  1258. {
  1259.     /* basic machine hardware */
  1260.     {
  1261.         {
  1262.             CPU_Z80,
  1263.             18432000/6,    /* 3.072 Mhz */
  1264.             type1_readmem,type1_writemem,0,0,
  1265.             scramble_vh_interrupt,1
  1266.         },
  1267.         {
  1268.             CPU_Z80 | CPU_AUDIO_CPU,
  1269.             14318000/8,    /* 1.78975 Mhz */
  1270.             sound_readmem,sound_writemem,sound_readport,sound_writeport,
  1271.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  1272.         }
  1273.     },
  1274.     60, 2500,    /* frames per second, vblank duration */
  1275.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1276.     scobra_init_machine,
  1277.  
  1278.     /* video hardware */
  1279.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1280.     armorcar_gfxdecodeinfo,
  1281.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  1282.     galaxian_vh_convert_color_prom,
  1283.  
  1284.     VIDEO_TYPE_RASTER,
  1285.     0,
  1286.     scramble_vh_start,
  1287.     generic_vh_stop,
  1288.     galaxian_vh_screenrefresh,
  1289.  
  1290.     /* sound hardware */
  1291.     0,0,0,0,
  1292.     {
  1293.         {
  1294.             SOUND_AY8910,
  1295.             &ay8910_interface
  1296.         }
  1297.     }
  1298. };
  1299.  
  1300. /* Rescue, Minefield and Strategy X have extra colours, and custom video initialise */
  1301. /* routines to set up the graduated colour backgound they use */
  1302. static struct MachineDriver machine_driver_rescue =
  1303. {
  1304.     /* basic machine hardware */
  1305.     {
  1306.         {
  1307.             CPU_Z80,
  1308.             18432000/6,    /* 3.072 Mhz */
  1309.             type1_readmem,type1_writemem,0,0,
  1310.             scramble_vh_interrupt,1
  1311.         },
  1312.         {
  1313.             CPU_Z80 | CPU_AUDIO_CPU,
  1314.             14318000/8,    /* 1.78975 Mhz */
  1315.             sound_readmem,sound_writemem,sound_readport,sound_writeport,
  1316.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  1317.         }
  1318.     },
  1319.     60, 2500,    /* frames per second, vblank duration */
  1320.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1321.     scobra_init_machine,
  1322.  
  1323.     /* video hardware */
  1324.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1325.     gfxdecodeinfo,
  1326.     32+64+64,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 64 for background */
  1327.     rescue_vh_convert_color_prom,
  1328.  
  1329.     VIDEO_TYPE_RASTER,
  1330.     0,
  1331.     rescue_vh_start,
  1332.     generic_vh_stop,
  1333.     galaxian_vh_screenrefresh,
  1334.  
  1335.     /* sound hardware */
  1336.     0,0,0,0,
  1337.     {
  1338.         {
  1339.             SOUND_AY8910,
  1340.             &ay8910_interface
  1341.         }
  1342.     }
  1343. };
  1344.  
  1345. static struct MachineDriver machine_driver_minefld =
  1346. {
  1347.     /* basic machine hardware */
  1348.     {
  1349.         {
  1350.             CPU_Z80,
  1351.             18432000/6,    /* 3.072 Mhz */
  1352.             type1_readmem,type1_writemem,0,0,
  1353.             scramble_vh_interrupt,1
  1354.         },
  1355.         {
  1356.             CPU_Z80 | CPU_AUDIO_CPU,
  1357.             14318000/8,    /* 1.78975 Mhz */
  1358.             sound_readmem,sound_writemem,sound_readport,sound_writeport,
  1359.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  1360.         }
  1361.     },
  1362.     60, 2500,    /* frames per second, vblank duration */
  1363.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1364.     scobra_init_machine,
  1365.  
  1366.     /* video hardware */
  1367.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1368.     gfxdecodeinfo,
  1369.     32+64+128,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 128 for background */
  1370.     minefld_vh_convert_color_prom,
  1371.  
  1372.     VIDEO_TYPE_RASTER,
  1373.     0,
  1374.     minefld_vh_start,
  1375.     generic_vh_stop,
  1376.     galaxian_vh_screenrefresh,
  1377.  
  1378.     /* sound hardware */
  1379.     0,0,0,0,
  1380.     {
  1381.         {
  1382.             SOUND_AY8910,
  1383.             &ay8910_interface
  1384.         }
  1385.     }
  1386. };
  1387.  
  1388. static struct MachineDriver machine_driver_stratgyx =
  1389. {
  1390.     /* basic machine hardware */
  1391.     {
  1392.         {
  1393.             CPU_Z80,
  1394.             18432000/6,    /* 3.072 Mhz */
  1395.             type2_readmem,type2_writemem,0,0,
  1396.             scramble_vh_interrupt,1
  1397.         },
  1398.         {
  1399.             CPU_Z80 | CPU_AUDIO_CPU,
  1400.             14318000/8,    /* 1.78975 Mhz */
  1401.             sound_readmem,sound_writemem,sound_readport,sound_writeport,
  1402.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  1403.         }
  1404.     },
  1405.     60, 2500,    /* frames per second, vblank duration */
  1406.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1407.     scobra_init_machine,
  1408.  
  1409.     /* video hardware */
  1410.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1411.     gfxdecodeinfo,
  1412.     32+64+2,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 2 for background */
  1413.     stratgyx_vh_convert_color_prom,
  1414.  
  1415.     VIDEO_TYPE_RASTER,
  1416.     0,
  1417.     stratgyx_vh_start,
  1418.     generic_vh_stop,
  1419.     galaxian_vh_screenrefresh,
  1420.  
  1421.     /* sound hardware */
  1422.     0,0,0,0,
  1423.     {
  1424.         {
  1425.             SOUND_AY8910,
  1426.             &ay8910_interface
  1427.         }
  1428.     }
  1429. };
  1430.  
  1431. static struct MachineDriver machine_driver_type2 =
  1432. {
  1433.     /* basic machine hardware */
  1434.     {
  1435.         {
  1436.             CPU_Z80,
  1437.             18432000/6,    /* 3.072 Mhz */
  1438.             type2_readmem,type2_writemem,0,0,
  1439.             scramble_vh_interrupt,1
  1440.         },
  1441.         {
  1442.             CPU_Z80 | CPU_AUDIO_CPU,
  1443.             14318000/8,    /* 1.78975 Mhz */
  1444.             sound_readmem,sound_writemem,sound_readport,sound_writeport,
  1445.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  1446.         }
  1447.     },
  1448.     60, 2500,    /* frames per second, vblank duration */
  1449.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1450.     scobra_init_machine,
  1451.  
  1452.     /* video hardware */
  1453.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1454.     gfxdecodeinfo,
  1455.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  1456.     galaxian_vh_convert_color_prom,
  1457.  
  1458.     VIDEO_TYPE_RASTER,
  1459.     0,
  1460.     scramble_vh_start,
  1461.     generic_vh_stop,
  1462.     galaxian_vh_screenrefresh,
  1463.  
  1464.     /* sound hardware */
  1465.     0,0,0,0,
  1466.     {
  1467.         {
  1468.             SOUND_AY8910,
  1469.             &ay8910_interface
  1470.         }
  1471.     }
  1472. };
  1473.  
  1474. static struct MachineDriver machine_driver_hustler =
  1475. {
  1476.     /* basic machine hardware */
  1477.     {
  1478.         {
  1479.             CPU_Z80,
  1480.             18432000/6,    /* 3.072 Mhz */
  1481.             hustler_readmem,hustler_writemem,0,0,
  1482.             scramble_vh_interrupt,1
  1483.         },
  1484.         {
  1485.             CPU_Z80 | CPU_AUDIO_CPU,
  1486.             14318000/8,    /* 1.78975 Mhz */
  1487.             hustler_sound_readmem,hustler_sound_writemem,hustler_sound_readport,hustler_sound_writeport,
  1488.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  1489.         }
  1490.     },
  1491.     60, 2500,    /* frames per second, vblank duration */
  1492.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1493.     scobra_init_machine,
  1494.  
  1495.     /* video hardware */
  1496.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1497.     gfxdecodeinfo,
  1498.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  1499.     galaxian_vh_convert_color_prom,
  1500.  
  1501.     VIDEO_TYPE_RASTER,
  1502.     0,
  1503.     scramble_vh_start,
  1504.     generic_vh_stop,
  1505.     galaxian_vh_screenrefresh,
  1506.  
  1507.     /* sound hardware */
  1508.     0,0,0,0,
  1509.     {
  1510.         {
  1511.             SOUND_AY8910,
  1512.             &hustler_ay8910_interface
  1513.         }
  1514.     }
  1515. };
  1516.  
  1517. static struct MachineDriver machine_driver_hustlerb =
  1518. {
  1519.     /* basic machine hardware */
  1520.     {
  1521.         {
  1522.             CPU_Z80,
  1523.             18432000/6,    /* 3.072 Mhz */
  1524.             hustlerb_readmem,hustlerb_writemem,0,0,
  1525.             scramble_vh_interrupt,1
  1526.         },
  1527.         {
  1528.             CPU_Z80 | CPU_AUDIO_CPU,
  1529.             14318000/8,    /* 1.78975 Mhz */
  1530.             sound_readmem,sound_writemem,hustlerb_sound_readport,hustlerb_sound_writeport,
  1531.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  1532.         }
  1533.     },
  1534.     60, 2500,    /* frames per second, vblank duration */
  1535.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1536.     scobra_init_machine,
  1537.  
  1538.     /* video hardware */
  1539.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1540.     gfxdecodeinfo,
  1541.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  1542.     galaxian_vh_convert_color_prom,
  1543.  
  1544.     VIDEO_TYPE_RASTER,
  1545.     0,
  1546.     scramble_vh_start,
  1547.     generic_vh_stop,
  1548.     galaxian_vh_screenrefresh,
  1549.  
  1550.     /* sound hardware */
  1551.     0,0,0,0,
  1552.     {
  1553.         {
  1554.             SOUND_AY8910,
  1555.             &hustler_ay8910_interface
  1556.         }
  1557.     }
  1558. };
  1559.  
  1560. static struct MachineDriver machine_driver_calipso =
  1561. {
  1562.     /* basic machine hardware */
  1563.     {
  1564.         {
  1565.             CPU_Z80,
  1566.             18432000/6,    /* 3.072 Mhz */
  1567.             type1_readmem,type1_writemem,0,0,
  1568.             scramble_vh_interrupt,1
  1569.         },
  1570.         {
  1571.             CPU_Z80 | CPU_AUDIO_CPU,
  1572.             14318000/8,    /* 1.78975 Mhz */
  1573.             sound_readmem,sound_writemem,sound_readport,sound_writeport,
  1574.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  1575.         }
  1576.     },
  1577.     60, 2500,    /* frames per second, vblank duration */
  1578.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1579.     scobra_init_machine,
  1580.  
  1581.     /* video hardware */
  1582.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1583.     calipso_gfxdecodeinfo,
  1584.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  1585.     galaxian_vh_convert_color_prom,
  1586.  
  1587.     VIDEO_TYPE_RASTER,
  1588.     0,
  1589.     calipso_vh_start,
  1590.     generic_vh_stop,
  1591.     galaxian_vh_screenrefresh,
  1592.  
  1593.     /* sound hardware */
  1594.     0,0,0,0,
  1595.     {
  1596.         {
  1597.             SOUND_AY8910,
  1598.             &ay8910_interface
  1599.         }
  1600.     }
  1601. };
  1602.  
  1603. /***************************************************************************
  1604.  
  1605.   Game driver(s)
  1606.  
  1607. ***************************************************************************/
  1608.  
  1609. ROM_START( scobra )
  1610.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1611.     ROM_LOAD( "2c",           0x0000, 0x1000, 0xa0744b3f )
  1612.     ROM_LOAD( "2e",           0x1000, 0x1000, 0x8e7245cd )
  1613.     ROM_LOAD( "2f",           0x2000, 0x1000, 0x47a4e6fb )
  1614.     ROM_LOAD( "2h",           0x3000, 0x1000, 0x7244f21c )
  1615.     ROM_LOAD( "2j",           0x4000, 0x1000, 0xe1f8a801 )
  1616.     ROM_LOAD( "2l",           0x5000, 0x1000, 0xd52affde )
  1617.  
  1618.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1619.     ROM_LOAD( "5c",           0x0000, 0x0800, 0xd4346959 )
  1620.     ROM_LOAD( "5d",           0x0800, 0x0800, 0xcc025d95 )
  1621.     ROM_LOAD( "5e",           0x1000, 0x0800, 0x1628c53f )
  1622.  
  1623.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1624.     ROM_LOAD( "5f",           0x0000, 0x0800, 0x64d113b4 )
  1625.     ROM_LOAD( "5h",           0x0800, 0x0800, 0xa96316d3 )
  1626.  
  1627.     ROM_REGION( 0x0020, REGION_PROMS )
  1628.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x9b87f90d )
  1629. ROM_END
  1630.  
  1631. ROM_START( scobras )
  1632.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1633.     ROM_LOAD( "scobra2c.bin", 0x0000, 0x1000, 0xe15ade38 )
  1634.     ROM_LOAD( "scobra2e.bin", 0x1000, 0x1000, 0xa270e44d )
  1635.     ROM_LOAD( "scobra2f.bin", 0x2000, 0x1000, 0xbdd70346 )
  1636.     ROM_LOAD( "scobra2h.bin", 0x3000, 0x1000, 0xdca5ec31 )
  1637.     ROM_LOAD( "scobra2j.bin", 0x4000, 0x1000, 0x0d8f6b6e )
  1638.     ROM_LOAD( "scobra2l.bin", 0x5000, 0x1000, 0x6f80f3a9 )
  1639.  
  1640.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1641.     ROM_LOAD( "snd_5c.bin",   0x0000, 0x0800, 0xdeeb0dd3 )
  1642.     ROM_LOAD( "snd_5d.bin",   0x0800, 0x0800, 0x872c1a74 )
  1643.     ROM_LOAD( "snd_5e.bin",   0x1000, 0x0800, 0xccd7a110 )
  1644.  
  1645.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1646.     ROM_LOAD( "5f",           0x0000, 0x0800, 0x64d113b4 )
  1647.     ROM_LOAD( "5h",           0x0800, 0x0800, 0xa96316d3 )
  1648.  
  1649.     ROM_REGION( 0x0020, REGION_PROMS )
  1650.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x9b87f90d )
  1651. ROM_END
  1652.  
  1653. ROM_START( scobrab )
  1654.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1655.     ROM_LOAD( "vid_2c.bin",   0x0000, 0x0800, 0xaeddf391 )
  1656.     ROM_LOAD( "vid_2e.bin",   0x0800, 0x0800, 0x72b57eb7 )
  1657.     ROM_LOAD( "scobra2e.bin", 0x1000, 0x1000, 0xa270e44d )
  1658.     ROM_LOAD( "scobra2f.bin", 0x2000, 0x1000, 0xbdd70346 )
  1659.     ROM_LOAD( "scobra2h.bin", 0x3000, 0x1000, 0xdca5ec31 )
  1660.     ROM_LOAD( "scobra2j.bin", 0x4000, 0x1000, 0x0d8f6b6e )
  1661.     ROM_LOAD( "scobra2l.bin", 0x5000, 0x1000, 0x6f80f3a9 )
  1662.  
  1663.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1664.     ROM_LOAD( "snd_5c.bin",   0x0000, 0x0800, 0xdeeb0dd3 )
  1665.     ROM_LOAD( "snd_5d.bin",   0x0800, 0x0800, 0x872c1a74 )
  1666.     ROM_LOAD( "snd_5e.bin",   0x1000, 0x0800, 0xccd7a110 )
  1667.  
  1668.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1669.     ROM_LOAD( "5f",           0x0000, 0x0800, 0x64d113b4 )
  1670.     ROM_LOAD( "5h",           0x0800, 0x0800, 0xa96316d3 )
  1671.  
  1672.     ROM_REGION( 0x0020, REGION_PROMS )
  1673.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x9b87f90d )
  1674. ROM_END
  1675.  
  1676. ROM_START( stratgyx )
  1677.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1678.     ROM_LOAD( "2c_1.bin",     0x0000, 0x1000, 0xeec01237 )
  1679.     ROM_LOAD( "2e_2.bin",     0x1000, 0x1000, 0x926cb2d5 )
  1680.     ROM_LOAD( "2f_3.bin",     0x2000, 0x1000, 0x849e2504 )
  1681.     ROM_LOAD( "2h_4.bin",     0x3000, 0x1000, 0x8a64069b )
  1682.     ROM_LOAD( "2j_5.bin",     0x4000, 0x1000, 0x78b9b898 )
  1683.     ROM_LOAD( "2l_6.bin",     0x5000, 0x1000, 0x20bae414 )
  1684.  
  1685.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound code */
  1686.     ROM_LOAD( "s1.bin",       0x0000, 0x1000, 0x713a5db8 )
  1687.     ROM_LOAD( "s2.bin",       0x1000, 0x1000, 0x46079411 )
  1688.  
  1689.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1690.     ROM_LOAD( "5f_c2.bin",    0x0000, 0x0800, 0x7121b679 )
  1691.     ROM_LOAD( "5h_c1.bin",    0x0800, 0x0800, 0xd105ad91 )
  1692.  
  1693.     ROM_REGION( 0x0020, REGION_PROMS )
  1694.     ROM_LOAD( "strategy.6e",  0x0000, 0x0020, 0x51a629e1 )
  1695. ROM_END
  1696.  
  1697. ROM_START( stratgys )
  1698.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1699.     ROM_LOAD( "2c.cpu",       0x0000, 0x1000, 0xf2aaaf2b )
  1700.     ROM_LOAD( "2e.cpu",       0x1000, 0x1000, 0x5873fdc8 )
  1701.     ROM_LOAD( "2f.cpu",       0x2000, 0x1000, 0x532d604f )
  1702.     ROM_LOAD( "2h.cpu",       0x3000, 0x1000, 0x82b1d95e )
  1703.     ROM_LOAD( "2j.cpu",       0x4000, 0x1000, 0x66e84cde )
  1704.     ROM_LOAD( "2l.cpu",       0x5000, 0x1000, 0x62b032d0 )
  1705.  
  1706.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound code */
  1707.     ROM_LOAD( "s1.bin",       0x0000, 0x1000, 0x713a5db8 )
  1708.     ROM_LOAD( "s2.bin",       0x1000, 0x1000, 0x46079411 )
  1709.  
  1710.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1711.     ROM_LOAD( "5f.cpu",       0x0000, 0x0800, 0xf4aa5ddd )
  1712.     ROM_LOAD( "5h.cpu",       0x0800, 0x0800, 0x548e4635 )
  1713.  
  1714.     ROM_REGION( 0x0020, REGION_PROMS )
  1715.     ROM_LOAD( "strategy.6e",  0x0000, 0x0020, 0x51a629e1 )
  1716. ROM_END
  1717.  
  1718. ROM_START( armorcar )
  1719.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1720.     ROM_LOAD( "cpu.2c",       0x0000, 0x1000, 0x0d7bfdfb )
  1721.     ROM_LOAD( "cpu.2e",       0x1000, 0x1000, 0x76463213 )
  1722.     ROM_LOAD( "cpu.2f",       0x2000, 0x1000, 0x2cc6d5f0 )
  1723.     ROM_LOAD( "cpu.2h",       0x3000, 0x1000, 0x61278dbb )
  1724.     ROM_LOAD( "cpu.2j",       0x4000, 0x1000, 0xfb158d8c )
  1725.  
  1726.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1727.     ROM_LOAD( "sound.5c",     0x0000, 0x0800, 0x54ee7753 )
  1728.     ROM_LOAD( "sound.5d",     0x0800, 0x0800, 0x5218fec0 )
  1729.  
  1730.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1731.     ROM_LOAD( "cpu.5f",       0x0000, 0x0800, 0x8a3da4d1 )
  1732.     ROM_LOAD( "cpu.5h",       0x0800, 0x0800, 0x85bdb113 )
  1733.  
  1734.     ROM_REGION( 0x0020, REGION_PROMS )
  1735.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x9b87f90d )
  1736. ROM_END
  1737.  
  1738. ROM_START( armorca2 )
  1739.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1740.     ROM_LOAD( "2c",           0x0000, 0x1000, 0xe393bd2f )
  1741.     ROM_LOAD( "2e",           0x1000, 0x1000, 0xb7d443af )
  1742.     ROM_LOAD( "2g",           0x2000, 0x1000, 0xe67380a4 )
  1743.     ROM_LOAD( "2h",           0x3000, 0x1000, 0x72af7b37 )
  1744.     ROM_LOAD( "2j",           0x4000, 0x1000, 0xe6b0dd7f )
  1745.  
  1746.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1747.     ROM_LOAD( "sound.5c",     0x0000, 0x0800, 0x54ee7753 )
  1748.     ROM_LOAD( "sound.5d",     0x0800, 0x0800, 0x5218fec0 )
  1749.  
  1750.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1751.     ROM_LOAD( "cpu.5f",       0x0000, 0x0800, 0x8a3da4d1 )
  1752.     ROM_LOAD( "cpu.5h",       0x0800, 0x0800, 0x85bdb113 )
  1753.  
  1754.     ROM_REGION( 0x0020, REGION_PROMS )
  1755.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x9b87f90d )
  1756. ROM_END
  1757.  
  1758. ROM_START( moonwar2 )
  1759.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1760.     ROM_LOAD( "mw2.2c",       0x0000, 0x1000, 0x7c11b4d9 )
  1761.     ROM_LOAD( "mw2.2e",       0x1000, 0x1000, 0x1b6362be )
  1762.     ROM_LOAD( "mw2.2f",       0x2000, 0x1000, 0x4fd8ba4b )
  1763.     ROM_LOAD( "mw2.2h",       0x3000, 0x1000, 0x56879f0d )
  1764.  
  1765.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1766.     ROM_LOAD( "mw2.5c",       0x0000, 0x0800, 0xc26231eb )
  1767.     ROM_LOAD( "mw2.5d",       0x0800, 0x0800, 0xbb48a646 )
  1768.  
  1769.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1770.     ROM_LOAD( "mw2.5f",       0x0000, 0x0800, 0xc5fa1aa0 )
  1771.     ROM_LOAD( "mw2.5h",       0x0800, 0x0800, 0xa6ccc652 )
  1772.  
  1773.     ROM_REGION( 0x0020, REGION_PROMS )
  1774.     ROM_LOAD( "mw2.clr",      0x0000, 0x0020, 0x99614c6c )
  1775. ROM_END
  1776.  
  1777. ROM_START( monwar2a )
  1778.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1779.     ROM_LOAD( "2c",           0x0000, 0x1000, 0xbc20b734 )
  1780.     ROM_LOAD( "2e",           0x1000, 0x1000, 0xdb6ffec2 )
  1781.     ROM_LOAD( "2f",           0x2000, 0x1000, 0x378931b8 )
  1782.     ROM_LOAD( "2h",           0x3000, 0x1000, 0x031dbc2c )
  1783.  
  1784.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1785.     ROM_LOAD( "mw2.5c",       0x0000, 0x0800, 0xc26231eb )
  1786.     ROM_LOAD( "mw2.5d",       0x0800, 0x0800, 0xbb48a646 )
  1787.  
  1788.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1789.     ROM_LOAD( "mw2.5f",       0x0000, 0x0800, 0xc5fa1aa0 )
  1790.     ROM_LOAD( "mw2.5h",       0x0800, 0x0800, 0xa6ccc652 )
  1791.  
  1792.     ROM_REGION( 0x0020, REGION_PROMS )
  1793.     ROM_LOAD( "mw2.clr",      0x0000, 0x0020, 0x99614c6c )
  1794. ROM_END
  1795.  
  1796. ROM_START( spdcoin )
  1797.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code */
  1798.     ROM_LOAD( "spdcoin.2c",   0x0000, 0x1000, 0x65cf1e49 )
  1799.     ROM_LOAD( "spdcoin.2e",   0x1000, 0x1000, 0x1ee59232 )
  1800.  
  1801.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the audio CPU */
  1802.     ROM_LOAD( "spdcoin.5c",   0x0000, 0x0800, 0xb4cf64b7 )
  1803.     ROM_LOAD( "spdcoin.5d",   0x0800, 0x0800, 0x92304df0 )
  1804.  
  1805.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1806.     ROM_LOAD( "spdcoin.5f",   0x0000, 0x0800, 0xdd5f1dbc )
  1807.     ROM_LOAD( "spdcoin.5h",   0x0800, 0x0800, 0xab1fe81b )
  1808.  
  1809.     ROM_REGION( 0x0020, REGION_PROMS )
  1810.     ROM_LOAD( "spdcoin.clr",  0x0000, 0x0020, 0x1a2ccc56 )
  1811. ROM_END
  1812.  
  1813. ROM_START( darkplnt )
  1814.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1815.     ROM_LOAD( "drkplt2c.dat", 0x0000, 0x1000, 0x5a0ca559 )
  1816.     ROM_LOAD( "drkplt2e.dat", 0x1000, 0x1000, 0x52e2117d )
  1817.     ROM_LOAD( "drkplt2g.dat", 0x2000, 0x1000, 0x4093219c )
  1818.     ROM_LOAD( "drkplt2j.dat", 0x3000, 0x1000, 0xb974c78d )
  1819.     ROM_LOAD( "drkplt2k.dat", 0x4000, 0x1000, 0x71a37385 )
  1820.     ROM_LOAD( "drkplt2l.dat", 0x5000, 0x1000, 0x5ad25154 )
  1821.     ROM_LOAD( "drkplt2m.dat", 0x6000, 0x1000, 0x8d2f0122 )
  1822.     ROM_LOAD( "drkplt2p.dat", 0x7000, 0x1000, 0x2d66253b )
  1823.  
  1824.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1825.     ROM_LOAD( "5c.snd",       0x0000, 0x1000, 0x672b9454 )
  1826.  
  1827.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1828.     ROM_LOAD( "drkplt5f.dat", 0x0000, 0x0800, 0x2af0ee66 )
  1829.     ROM_LOAD( "drkplt5h.dat", 0x0800, 0x0800, 0x66ef3225 )
  1830.  
  1831.     ROM_REGION( 0x0020, REGION_PROMS )
  1832.     ROM_LOAD( "6e.cpu",       0x0000, 0x0020, 0x86b6e124 )
  1833. ROM_END
  1834.  
  1835. ROM_START( tazmania )
  1836.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1837.     ROM_LOAD( "2c.cpu",       0x0000, 0x1000, 0x932c5a06 )
  1838.     ROM_LOAD( "2e.cpu",       0x1000, 0x1000, 0xef17ce65 )
  1839.     ROM_LOAD( "2f.cpu",       0x2000, 0x1000, 0x43c7c39d )
  1840.     ROM_LOAD( "2h.cpu",       0x3000, 0x1000, 0xbe829694 )
  1841.     ROM_LOAD( "2j.cpu",       0x4000, 0x1000, 0x6e197271 )
  1842.     ROM_LOAD( "2k.cpu",       0x5000, 0x1000, 0xa1eb453b )
  1843.  
  1844.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1845.     ROM_LOAD( "rom0.snd",     0x0000, 0x0800, 0xb8d741f1 )
  1846.  
  1847.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1848.     ROM_LOAD( "5f.cpu",       0x0000, 0x0800, 0x2c5b612b )
  1849.     ROM_LOAD( "5h.cpu",       0x0800, 0x0800, 0x3f5ff3ac )
  1850.  
  1851.     ROM_REGION( 0x0020, REGION_PROMS )
  1852.     ROM_LOAD( "colr6f.cpu",   0x0000, 0x0020, 0xfce333c7 )
  1853. ROM_END
  1854.  
  1855. ROM_START( tazmani2 )
  1856.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1857.     ROM_LOAD( "2ck.cpu",      0x0000, 0x1000, 0xbf0492bf )
  1858.     ROM_LOAD( "2ek.cpu",      0x1000, 0x1000, 0x6636c4d0 )
  1859.     ROM_LOAD( "2fk.cpu",      0x2000, 0x1000, 0xce59a57b )
  1860.     ROM_LOAD( "2hk.cpu",      0x3000, 0x1000, 0x8bda3380 )
  1861.     ROM_LOAD( "2jk.cpu",      0x4000, 0x1000, 0xa4095e35 )
  1862.     ROM_LOAD( "2kk.cpu",      0x5000, 0x1000, 0xf308ca36 )
  1863.  
  1864.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1865.     ROM_LOAD( "rom0.snd",     0x0000, 0x0800, 0xb8d741f1 )
  1866.  
  1867.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1868.     ROM_LOAD( "5f.cpu",       0x0000, 0x0800, 0x2c5b612b )
  1869.     ROM_LOAD( "5h.cpu",       0x0800, 0x0800, 0x3f5ff3ac )
  1870.  
  1871.     ROM_REGION( 0x0020, REGION_PROMS )
  1872.     ROM_LOAD( "colr6f.cpu",   0x0000, 0x0020, 0xfce333c7 )
  1873. ROM_END
  1874.  
  1875. ROM_START( calipso )
  1876.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1877.     ROM_LOAD( "calipso.2c",   0x0000, 0x1000, 0x0fcb703c )
  1878.     ROM_LOAD( "calipso.2e",   0x1000, 0x1000, 0xc6622f14 )
  1879.     ROM_LOAD( "calipso.2f",   0x2000, 0x1000, 0x7bacbaba )
  1880.     ROM_LOAD( "calipso.2h",   0x3000, 0x1000, 0xa3a8111b )
  1881.     ROM_LOAD( "calipso.2j",   0x4000, 0x1000, 0xfcbd7b9e )
  1882.     ROM_LOAD( "calipso.2l",   0x5000, 0x1000, 0xf7630cab )
  1883.  
  1884.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound code */
  1885.     ROM_LOAD( "calipso.5c",   0x0000, 0x0800, 0x9cbc65ab )
  1886.     ROM_LOAD( "calipso.5d",   0x0800, 0x0800, 0xa225ee3b )
  1887.  
  1888.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1889.     ROM_LOAD( "calipso.5f",   0x0000, 0x2000, 0xfd4252e9 )
  1890.     ROM_LOAD( "calipso.5h",   0x2000, 0x2000, 0x1663a73a )
  1891.  
  1892.     ROM_REGION( 0x0020, REGION_PROMS )
  1893.     ROM_LOAD( "calipso.clr",  0x0000, 0x0020, 0x01165832 )
  1894. ROM_END
  1895.  
  1896. ROM_START( anteater )
  1897.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1898.     ROM_LOAD( "ra1-2c",       0x0000, 0x1000, 0x58bc9393 )
  1899.     ROM_LOAD( "ra1-2e",       0x1000, 0x1000, 0x574fc6f6 )
  1900.     ROM_LOAD( "ra1-2f",       0x2000, 0x1000, 0x2f7c1fe5 )
  1901.     ROM_LOAD( "ra1-2h",       0x3000, 0x1000, 0xae8a5da3 )
  1902.  
  1903.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1904.     ROM_LOAD( "ra4-5c",       0x0000, 0x0800, 0x87300b4f )
  1905.     ROM_LOAD( "ra4-5d",       0x0800, 0x0800, 0xaf4e5ffe )
  1906.  
  1907.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1908.     ROM_LOAD( "ra6-5f",       0x1000, 0x0800, 0x4c3f8a08 )    /* we load the roms at 0x1000-0x1fff, they */
  1909.     ROM_LOAD( "ra6-5h",       0x1800, 0x0800, 0xb30c7c9f )    /* will be decrypted at 0x0000-0x0fff */
  1910.  
  1911.     ROM_REGION( 0x0020, REGION_PROMS )
  1912.     ROM_LOAD( "colr6f.cpu",   0x0000, 0x0020, 0xfce333c7 )
  1913. ROM_END
  1914.  
  1915. ROM_START( rescue )
  1916.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1917.     ROM_LOAD( "rb15acpu.bin", 0x0000, 0x1000, 0xd7e654ba )
  1918.     ROM_LOAD( "rb15bcpu.bin", 0x1000, 0x1000, 0xa93ea158 )
  1919.     ROM_LOAD( "rb15ccpu.bin", 0x2000, 0x1000, 0x058cd3d0 )
  1920.     ROM_LOAD( "rb15dcpu.bin", 0x3000, 0x1000, 0xd6505742 )
  1921.     ROM_LOAD( "rb15ecpu.bin", 0x4000, 0x1000, 0x604df3a4 )
  1922.  
  1923.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1924.     ROM_LOAD( "rb15csnd.bin", 0x0000, 0x0800, 0x8b24bf17 )
  1925.     ROM_LOAD( "rb15dsnd.bin", 0x0800, 0x0800, 0xd96e4fb3 )
  1926.  
  1927.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1928.     ROM_LOAD( "rb15fcpu.bin", 0x1000, 0x0800, 0x4489d20c )    /* we load the roms at 0x1000-0x1fff, they */
  1929.     ROM_LOAD( "rb15hcpu.bin", 0x1800, 0x0800, 0x5512c547 )    /* will be decrypted at 0x0000-0x0fff */
  1930.  
  1931.     ROM_REGION( 0x0020, REGION_PROMS )
  1932.     ROM_LOAD( "rescue.clr",   0x0000, 0x0020, 0x40c6bcbd )
  1933. ROM_END
  1934.  
  1935. ROM_START( minefld )
  1936.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1937.     ROM_LOAD( "ma22c",        0x0000, 0x1000, 0x1367a035 )
  1938.     ROM_LOAD( "ma22e",        0x1000, 0x1000, 0x68946d21 )
  1939.     ROM_LOAD( "ma22f",        0x2000, 0x1000, 0x7663aee5 )
  1940.     ROM_LOAD( "ma22h",        0x3000, 0x1000, 0x9787475d )
  1941.     ROM_LOAD( "ma22j",        0x4000, 0x1000, 0x2ceceb54 )
  1942.     ROM_LOAD( "ma22l",        0x5000, 0x1000, 0x85138fc9 )
  1943.  
  1944.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1945.     ROM_LOAD( "ma15c",        0x0000, 0x0800, 0x8bef736b )
  1946.     ROM_LOAD( "ma15d",        0x0800, 0x0800, 0xf67b3f97 )
  1947.  
  1948.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1949.     ROM_LOAD( "ma15f",        0x1000, 0x0800, 0x9f703006 )    /* we load the roms at 0x1000-0x1fff, they */
  1950.     ROM_LOAD( "ma15h",        0x1800, 0x0800, 0xed0dccb1 )    /* will be decrypted at 0x0000-0x0fff */
  1951.  
  1952.     ROM_REGION( 0x0020, REGION_PROMS )
  1953.     ROM_LOAD( "minefld.clr",  0x0000, 0x0020, 0x1877368e )
  1954. ROM_END
  1955.  
  1956. ROM_START( losttomb )
  1957.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1958.     ROM_LOAD( "2c",           0x0000, 0x1000, 0xd6176d2c )
  1959.     ROM_LOAD( "2e",           0x1000, 0x1000, 0xa5f55f4a )
  1960.     ROM_LOAD( "2f",           0x2000, 0x1000, 0x0169fa3c )
  1961.     ROM_LOAD( "2h-easy",      0x3000, 0x1000, 0x054481b6 )
  1962.     ROM_LOAD( "2j",           0x4000, 0x1000, 0x249ee040 )
  1963.     ROM_LOAD( "2l",           0x5000, 0x1000, 0xc7d2e608 )
  1964.     ROM_LOAD( "2m",           0x6000, 0x1000, 0xbc4bc5b1 )
  1965.  
  1966.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1967.     ROM_LOAD( "5c",           0x0000, 0x0800, 0xb899be2a )
  1968.     ROM_LOAD( "5d",           0x0800, 0x0800, 0x6907af31 )
  1969.  
  1970.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1971.     ROM_LOAD( "5f",           0x1000, 0x0800, 0x61f137e7 )    /* we load the roms at 0x1000-0x1fff, they */
  1972.     ROM_LOAD( "5h",           0x1800, 0x0800, 0x5581de5f )    /* will be decrypted at 0x0000-0x0fff */
  1973.  
  1974.     ROM_REGION( 0x0020, REGION_PROMS )
  1975.     ROM_LOAD( "ltprom",       0x0000, 0x0020, 0x1108b816 )
  1976. ROM_END
  1977.  
  1978. ROM_START( losttmbh )
  1979.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  1980.     ROM_LOAD( "2c",           0x0000, 0x1000, 0xd6176d2c )
  1981.     ROM_LOAD( "2e",           0x1000, 0x1000, 0xa5f55f4a )
  1982.     ROM_LOAD( "2f",           0x2000, 0x1000, 0x0169fa3c )
  1983.     ROM_LOAD( "lthard",       0x3000, 0x1000, 0xe32cbf0e )
  1984.     ROM_LOAD( "2j",           0x4000, 0x1000, 0x249ee040 )
  1985.     ROM_LOAD( "2l",           0x5000, 0x1000, 0xc7d2e608 )
  1986.     ROM_LOAD( "2m",           0x6000, 0x1000, 0xbc4bc5b1 )
  1987.  
  1988.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  1989.     ROM_LOAD( "5c",           0x0000, 0x0800, 0xb899be2a )
  1990.     ROM_LOAD( "5d",           0x0800, 0x0800, 0x6907af31 )
  1991.  
  1992.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  1993.     ROM_LOAD( "5f",           0x1000, 0x0800, 0x61f137e7 )    /* we load the roms at 0x1000-0x1fff, they */
  1994.     ROM_LOAD( "5h",           0x1800, 0x0800, 0x5581de5f )    /* will be decrypted at 0x0000-0x0fff */
  1995.  
  1996.     ROM_REGION( 0x0020, REGION_PROMS )
  1997.     ROM_LOAD( "ltprom",       0x0000, 0x0020, 0x1108b816 )
  1998. ROM_END
  1999.  
  2000. ROM_START( superbon )
  2001.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2002.     ROM_LOAD( "2d.cpu",       0x0000, 0x1000, 0x60c0ba18 )
  2003.     ROM_LOAD( "2e.cpu",       0x1000, 0x1000, 0xddcf44bf )
  2004.     ROM_LOAD( "2f.cpu",       0x2000, 0x1000, 0xbb66c2d5 )
  2005.     ROM_LOAD( "2h.cpu",       0x3000, 0x1000, 0x74f4f04d )
  2006.     ROM_LOAD( "2j.cpu",       0x4000, 0x1000, 0x78effb08 )
  2007.     ROM_LOAD( "2l.cpu",       0x5000, 0x1000, 0xe9dcecbd )
  2008.     ROM_LOAD( "2m.cpu",       0x6000, 0x1000, 0x3ed0337e )
  2009.  
  2010.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  2011.     ROM_LOAD( "5c",            0x0000, 0x0800, 0xb899be2a )
  2012.     ROM_LOAD( "5d.snd",       0x0800, 0x0800, 0x80640a04 )
  2013.  
  2014.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2015.     ROM_LOAD( "5f.cpu",       0x0000, 0x0800, 0x5b9d4686 )
  2016.     ROM_LOAD( "5h.cpu",       0x0800, 0x0800, 0x58c29927 )
  2017.  
  2018.     ROM_REGION( 0x0020, REGION_PROMS )
  2019.     ROM_LOAD( "superbon.clr", 0x0000, 0x0020, 0x00000000 )
  2020. ROM_END
  2021.  
  2022. ROM_START( hustler )
  2023.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2024.     ROM_LOAD( "hustler.1",    0x0000, 0x1000, 0x94479a3e )
  2025.     ROM_LOAD( "hustler.2",    0x1000, 0x1000, 0x3cc67bcc )
  2026.     ROM_LOAD( "hustler.3",    0x2000, 0x1000, 0x9422226a )
  2027.     /* 3000-3fff space for diagnostics ROM */
  2028.  
  2029.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  2030.     ROM_LOAD( "hustler.6",    0x0000, 0x0800, 0x7a946544 )
  2031.     ROM_LOAD( "hustler.7",    0x0800, 0x0800, 0x3db57351 )
  2032.  
  2033.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2034.     ROM_LOAD( "hustler.5f",   0x0000, 0x0800, 0x0bdfad0e )
  2035.     ROM_LOAD( "hustler.5h",   0x0800, 0x0800, 0x8e062177 )
  2036.  
  2037.     ROM_REGION( 0x0020, REGION_PROMS )
  2038.     ROM_LOAD( "hustler.clr",  0x0000, 0x0020, 0xaa1f7f5e )
  2039. ROM_END
  2040.  
  2041. ROM_START( billiard )
  2042.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2043.     ROM_LOAD( "a",            0x0000, 0x1000, 0xb7eb50c0 )
  2044.     ROM_LOAD( "b",            0x1000, 0x1000, 0x988fe1c5 )
  2045.     ROM_LOAD( "c",            0x2000, 0x1000, 0x7b8de793 )
  2046.     /* 3000-3fff space for diagnostics ROM */
  2047.  
  2048.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  2049.     ROM_LOAD( "hustler.6",    0x0000, 0x0800, 0x7a946544 )
  2050.     ROM_LOAD( "hustler.7",    0x0800, 0x0800, 0x3db57351 )
  2051.  
  2052.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2053.     ROM_LOAD( "hustler.5f",   0x0000, 0x0800, 0x0bdfad0e )
  2054.     ROM_LOAD( "hustler.5h",   0x0800, 0x0800, 0x8e062177 )
  2055.  
  2056.     ROM_REGION( 0x0020, REGION_PROMS )
  2057.     ROM_LOAD( "hustler.clr",  0x0000, 0x0020, 0xaa1f7f5e )
  2058. ROM_END
  2059.  
  2060. /* this is identical to billiard, but with a different memory map */
  2061. ROM_START( hustlerb )
  2062.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2063.     ROM_LOAD( "hustler.2c",   0x0000, 0x1000, 0x3a1ac6a9 )
  2064.     ROM_LOAD( "hustler.2f",   0x1000, 0x1000, 0xdc6752ec )
  2065.     ROM_LOAD( "hustler.2j",   0x2000, 0x1000, 0x27c1e0f8 )
  2066.     /* 3000-3fff space for diagnostics ROM */
  2067.  
  2068.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  2069.     ROM_LOAD( "hustler.11d",  0x0000, 0x0800, 0xb559bfde )
  2070.     ROM_LOAD( "hustler.10d",  0x0800, 0x0800, 0x6ef96cfb )
  2071.  
  2072.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2073.     ROM_LOAD( "hustler.5f",   0x0000, 0x0800, 0x0bdfad0e )
  2074.     ROM_LOAD( "hustler.5h",   0x0800, 0x0800, 0x8e062177 )
  2075.  
  2076.     ROM_REGION( 0x0020, REGION_PROMS )
  2077.     ROM_LOAD( "hustler.clr",  0x0000, 0x0020, 0xaa1f7f5e )
  2078. ROM_END
  2079.  
  2080.  
  2081.  
  2082. static void init_moonwar2(void)
  2083. {
  2084.     /* Install special handler for the spinner */
  2085.     install_mem_read_handler(0, 0x9800, 0x9800, moonwar2_IN0_r);
  2086. }
  2087.  
  2088.  
  2089. static int bit(int i,int n)
  2090. {
  2091.     return ((i >> n) & 1);
  2092. }
  2093.  
  2094.  
  2095. static void init_anteater(void)
  2096. {
  2097.     /*
  2098.     *   Code To Decode Lost Tomb by Mirko Buffoni
  2099.     *   Optimizations done by Fabio Buffoni
  2100.     */
  2101.     int i,j;
  2102.     unsigned char *RAM;
  2103.  
  2104.  
  2105.     /* The gfx ROMs are scrambled. Decode them. They have been loaded at 0x1000, */
  2106.     /* we write them at 0x0000. */
  2107.     RAM = memory_region(REGION_GFX1);
  2108.  
  2109.     for (i = 0;i < 0x1000;i++)
  2110.     {
  2111.         j = i & 0x9bf;
  2112.         j |= ( bit(i,4) ^ bit(i,9) ^ ( bit(i,2) & bit(i,10) ) ) << 6;
  2113.         j |= ( bit(i,2) ^ bit(i,10) ) << 9;
  2114.         j |= ( bit(i,0) ^ bit(i,6) ^ 1 ) << 10;
  2115.         RAM[i] = RAM[j + 0x1000];
  2116.     }
  2117. }
  2118.  
  2119. static void init_rescue(void)
  2120. {
  2121.     /*
  2122.     *   Code To Decode Lost Tomb by Mirko Buffoni
  2123.     *   Optimizations done by Fabio Buffoni
  2124.     */
  2125.     int i,j;
  2126.     unsigned char *RAM;
  2127.  
  2128.  
  2129.     /* The gfx ROMs are scrambled. Decode them. They have been loaded at 0x1000, */
  2130.     /* we write them at 0x0000. */
  2131.     RAM = memory_region(REGION_GFX1);
  2132.  
  2133.     for (i = 0;i < 0x1000;i++)
  2134.     {
  2135.         j = i & 0xa7f;
  2136.         j |= ( bit(i,3) ^ bit(i,10) ) << 7;
  2137.         j |= ( bit(i,1) ^ bit(i,7) ) << 8;
  2138.         j |= ( bit(i,0) ^ bit(i,8) ) << 10;
  2139.         RAM[i] = RAM[j + 0x1000];
  2140.     }
  2141. }
  2142.  
  2143. static void init_minefld(void)
  2144. {
  2145.     /*
  2146.     *   Code To Decode Minefield by Mike Balfour and Nicola Salmoria
  2147.     */
  2148.     int i,j;
  2149.     unsigned char *RAM;
  2150.  
  2151.  
  2152.     /* The gfx ROMs are scrambled. Decode them. They have been loaded at 0x1000, */
  2153.     /* we write them at 0x0000. */
  2154.     RAM = memory_region(REGION_GFX1);
  2155.  
  2156.     for (i = 0;i < 0x1000;i++)
  2157.     {
  2158.         j = i & 0xd5f;
  2159.         j |= ( bit(i,3) ^ bit(i,7) ) << 5;
  2160.         j |= ( bit(i,2) ^ bit(i,9) ^ ( bit(i,0) & bit(i,5) ) ^
  2161.                 ( bit(i,3) & bit(i,7) & ( bit(i,0) ^ bit(i,5) ))) << 7;
  2162.         j |= ( bit(i,0) ^ bit(i,5) ^ ( bit(i,3) & bit(i,7) ) ) << 9;
  2163.         RAM[i] = RAM[j + 0x1000];
  2164.     }
  2165. }
  2166.  
  2167. static void init_losttomb(void)
  2168. {
  2169.     /*
  2170.     *   Code To Decode Lost Tomb by Mirko Buffoni
  2171.     *   Optimizations done by Fabio Buffoni
  2172.     */
  2173.     int i,j;
  2174.     unsigned char *RAM;
  2175.  
  2176.  
  2177.     /* The gfx ROMs are scrambled. Decode them. They have been loaded at 0x1000, */
  2178.     /* we write them at 0x0000. */
  2179.     RAM = memory_region(REGION_GFX1);
  2180.  
  2181.     for (i = 0;i < 0x1000;i++)
  2182.     {
  2183.         j = i & 0xa7f;
  2184.         j |= ( (bit(i,1) & bit(i,8)) | ((1 ^ bit(i,1)) & (bit(i,10)))) << 7;
  2185.         j |= ( bit(i,7) ^ (bit(i,1) & ( bit(i,7) ^ bit(i,10) ))) << 8;
  2186.         j |= ( (bit(i,1) & bit(i,7)) | ((1 ^ bit(i,1)) & (bit(i,8)))) << 10;
  2187.         RAM[i] = RAM[j + 0x1000];
  2188.     }
  2189. }
  2190.  
  2191. static void init_superbon(void)
  2192. {
  2193.     /*
  2194.     *   Code rom deryption worked out by hand by Chris Hardy.
  2195.     */
  2196.     int i;
  2197.     unsigned char *RAM;
  2198.  
  2199.  
  2200.     RAM = memory_region(REGION_CPU1);
  2201.  
  2202.     for (i = 0;i < 0x1000;i++)
  2203.     {
  2204.         /* Code is encrypted depending on bit 7 and 9 of the address */
  2205.         switch (i & 0x280)
  2206.         {
  2207.             case 0x000:
  2208.                 RAM[i] ^= 0x92;
  2209.                 break;
  2210.             case 0x080:
  2211.                 RAM[i] ^= 0x82;
  2212.                 break;
  2213.             case 0x200:
  2214.                 RAM[i] ^= 0x12;
  2215.                 break;
  2216.             case 0x280:
  2217.                 RAM[i] ^= 0x10;
  2218.                 break;
  2219.         }
  2220.     }
  2221. }
  2222.  
  2223.  
  2224. static void init_hustler(void)
  2225. {
  2226.     int A;
  2227.  
  2228.  
  2229.     for (A = 0;A < 0x4000;A++)
  2230.     {
  2231.         unsigned char xormask;
  2232.         int bits[8];
  2233.         int i;
  2234.         unsigned char *RAM = memory_region(REGION_CPU1);
  2235.  
  2236.  
  2237.         for (i = 0;i < 8;i++)
  2238.             bits[i] = (A >> i) & 1;
  2239.  
  2240.         xormask = 0xff;
  2241.         if (bits[0] ^ bits[1]) xormask ^= 0x01;
  2242.         if (bits[3] ^ bits[6]) xormask ^= 0x02;
  2243.         if (bits[4] ^ bits[5]) xormask ^= 0x04;
  2244.         if (bits[0] ^ bits[2]) xormask ^= 0x08;
  2245.         if (bits[2] ^ bits[3]) xormask ^= 0x10;
  2246.         if (bits[1] ^ bits[5]) xormask ^= 0x20;
  2247.         if (bits[0] ^ bits[7]) xormask ^= 0x40;
  2248.         if (bits[4] ^ bits[6]) xormask ^= 0x80;
  2249.  
  2250.         RAM[A] ^= xormask;
  2251.     }
  2252.  
  2253.     /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
  2254.     {
  2255.         unsigned char *RAM = memory_region(REGION_CPU2);
  2256.  
  2257.  
  2258.         for (A = 0;A < 0x0800;A++)
  2259.             RAM[A] = (RAM[A] & 0xfc) | ((RAM[A] & 1) << 1) | ((RAM[A] & 2) >> 1);
  2260.     }
  2261. }
  2262.  
  2263. static void init_billiard(void)
  2264. {
  2265.     int A;
  2266.  
  2267.  
  2268.     for (A = 0;A < 0x4000;A++)
  2269.     {
  2270.         unsigned char xormask;
  2271.         int bits[8];
  2272.         int i;
  2273.         unsigned char *RAM = memory_region(REGION_CPU1);
  2274.  
  2275.  
  2276.         for (i = 0;i < 8;i++)
  2277.             bits[i] = (A >> i) & 1;
  2278.  
  2279.         xormask = 0x55;
  2280.         if (bits[2] ^ ( bits[3] &  bits[6])) xormask ^= 0x01;
  2281.         if (bits[4] ^ ( bits[5] &  bits[7])) xormask ^= 0x02;
  2282.         if (bits[0] ^ ( bits[7] & !bits[3])) xormask ^= 0x04;
  2283.         if (bits[3] ^ (!bits[0] &  bits[2])) xormask ^= 0x08;
  2284.         if (bits[5] ^ (!bits[4] &  bits[1])) xormask ^= 0x10;
  2285.         if (bits[6] ^ (!bits[2] & !bits[5])) xormask ^= 0x20;
  2286.         if (bits[1] ^ (!bits[6] & !bits[4])) xormask ^= 0x40;
  2287.         if (bits[7] ^ (!bits[1] &  bits[0])) xormask ^= 0x80;
  2288.  
  2289.         RAM[A] ^= xormask;
  2290.  
  2291.         for (i = 0;i < 8;i++)
  2292.             bits[i] = (RAM[A] >> i) & 1;
  2293.  
  2294.         RAM[A] =
  2295.             (bits[7] << 0) +
  2296.             (bits[0] << 1) +
  2297.             (bits[3] << 2) +
  2298.             (bits[4] << 3) +
  2299.             (bits[5] << 4) +
  2300.             (bits[2] << 5) +
  2301.             (bits[1] << 6) +
  2302.             (bits[6] << 7);
  2303.     }
  2304.  
  2305.     /* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
  2306.     {
  2307.         unsigned char *RAM = memory_region(REGION_CPU2);
  2308.  
  2309.  
  2310.         for (A = 0;A < 0x0800;A++)
  2311.             RAM[A] = (RAM[A] & 0xfc) | ((RAM[A] & 1) << 1) | ((RAM[A] & 2) >> 1);
  2312.     }
  2313. }
  2314.  
  2315.  
  2316.  
  2317. GAME( 1981, scobra,   0,        type1,    scobrak,  0,        ROT90,  "Konami", "Super Cobra" )
  2318. GAME( 1981, scobras,  scobra,   type1,    scobra,   0,        ROT90,  "[Konami] (Stern license)", "Super Cobra (Stern)" )
  2319. GAME( 1981, scobrab,  scobra,   type1,    scobra,   0,        ROT90,  "bootleg", "Super Cobra (bootleg)" )
  2320. GAME( 1981, stratgyx, 0,        stratgyx, stratgyx, 0,        ROT0,   "Konami", "Strategy X" )
  2321. GAME( 1981, stratgys, stratgyx, stratgyx, stratgyx, 0,        ROT0,   "[Konami] (Stern license)", "Strategy X (Stern)" )
  2322. GAME( 1981, armorcar, 0,        armorcar, armorcar, 0,        ROT90,  "Stern", "Armored Car (set 1)" )
  2323. GAME( 1981, armorca2, armorcar, armorcar, armorcar, 0,        ROT90,  "Stern", "Armored Car (set 2)" )
  2324. GAME( 1981, moonwar2, 0,        type1,    moonwar2, moonwar2, ROT90,  "Stern", "Moon War II (set 1)" )
  2325. GAME( 1981, monwar2a, moonwar2, type1,    monwar2a, moonwar2, ROT90,  "Stern", "Moon War II (set 2)" )
  2326. GAME( 1984, spdcoin,  0,        type1,    spdcoin,  0,        ROT90,  "Stern",    "Speed Coin (prototype)" )
  2327. GAMEX(1982, darkplnt, 0,        type2,    darkplnt, 0,        ROT180, "Stern", "Dark Planet", GAME_NOT_WORKING )
  2328. GAME( 1982, tazmania, 0,        type1,    tazmania, 0,        ROT90,  "Stern", "Tazz-Mania (Scramble hardware)" )
  2329. GAME( 1982, tazmani2, tazmania, type2,    tazmania, 0,        ROT90,  "Stern", "Tazz-Mania (Strategy X hardware)" )
  2330. GAME( 1982, calipso,  0,        calipso,  calipso,  0,        ROT90,  "[Stern] (Tago license)", "Calipso" )
  2331. GAME( 1982, anteater, 0,        type1,    anteater, anteater, ROT90,  "[Stern] (Tago license)", "Anteater" )
  2332. GAME( 1982, rescue,   0,        rescue,   rescue,   rescue,   ROT90,  "Stern", "Rescue" )
  2333. GAME( 1983, minefld,  0,        minefld,  minefld,  minefld,  ROT90,  "Stern", "Minefield" )
  2334. GAME( 1982, losttomb, 0,        type1,    losttomb, losttomb, ROT90,  "Stern", "Lost Tomb (easy)" )
  2335. GAME( 1982, losttmbh, losttomb, type1,    losttomb, losttomb, ROT90,  "Stern", "Lost Tomb (hard)" )
  2336. GAME( 1982?,superbon, 0,        type1,    superbon, superbon, ROT90,  "bootleg", "Super Bond" )
  2337. GAME( 1981, hustler,  0,        hustler,  hustler,  hustler,  ROT90,  "Konami", "Video Hustler" )
  2338. GAME( 1981, billiard, hustler,  hustler,  hustler,  billiard, ROT90,  "bootleg", "The Billiards" )
  2339. GAME( 1981, hustlerb, hustler,  hustlerb, hustler,  0,        ROT90,  "bootleg", "Video Hustler (bootleg)" )
  2340.